var t = getApp();

Page({
    data: {
        active: 0,
        current_page: 1,
        last_page: 1,
        page_data: [],
        status: null
    },
    more_data_page: function(t) {
        var a = t.detail, e = a.current_page, s = a.last_page, i = a.status;
        this.setData({
            current_page: e,
            status: i,
            last_page: s
        });
    },
    onChange: function(t) {
        var a = t.detail;
        this.setData({
            active: a
        }), 2 == a ? wx.setNavigationBarTitle({
            title: "商学院"
        }) : 3 == a ? wx.setNavigationBarTitle({
            title: "我的"
        }) : wx.setNavigationBarTitle({
            title: "签到认购"
        });
    },
    onLoad: function(t) {
        console.log(t), this.setData({
            active: 1 * t.active || 0
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        var a = this;
        if (1 == this.data.active) {
            if (this.data.current_page >= this.data.last_page) return;
            var e = {};
            e.page = this.data.current_page + 1, this.data.status && (e.status = this.data.status), 
            t._getNetWork({
                url: t.getNetAddresss("plugin.sign-buy.frontend.sign-buy-page.activity-list"),
                data: e,
                success: function(e) {
                    var s = e.data, i = s.result, n = s.data, r = s.msg;
                    if (0 == i) return t.tips(r);
                    var o = a.data.page_data.concat(n.data);
                    a.setData({
                        page_data: o,
                        current_page: n.current_page,
                        last_page: n.last_page
                    });
                }
            }), this.setData({
                page_data: this.data.page_data
            });
        }
    },
    onShareAppMessage: function() {}
});